17dd5cd18736a11255dad686286aa0b30ead8a42,src/java/org/apache/cassandra/db/columniterator/SSTableNamesIterator.java,SSTableNamesIterator,readIndexedColumns,#CFMetaData#FileDataInput#SortedSet#List#List#number#,214
Before Change
// TODO only completely deserialize columns we are interested in
while (file.bytesPastMark(mark) < indexInfo.width)
{
IColumn column = cf.getColumnSerializer().deserialize(file);
// we check vs the original Set, not the filtered List, for efficiency
if (columnNames.contains(column.name()))
{
After Change
}
}
private void readIndexedColumns(CFMetaData metadata, FileDataInput file, SortedSet<ByteBuffer> columnNames, List<ByteBuffer> filteredColumnNames, List<IndexHelper.IndexInfo> indexList, long basePosition)
throws IOException
{
/* get the various column ranges we have to read */
AbstractType<?> comparator = metadata.comparator;
SortedSet<IndexHelper.IndexInfo> ranges = new TreeSet<IndexHelper.IndexInfo>(IndexHelper.getComparator(comparator, false));
for (ByteBuffer name : filteredColumnNames)
{
int index = IndexHelper.indexFor(name, indexList, comparator, false);
if (index == indexList.size())
continue;
IndexHelper.IndexInfo indexInfo = indexList.get(index);
if (comparator.compare(name, indexInfo.firstName) < 0)
continue;
ranges.add(indexInfo);
}
if (ranges.isEmpty())
return;
for (IndexHelper.IndexInfo indexInfo : ranges)
{
long positionToSeek = basePosition + indexInfo.offset;
// With new promoted indexes, our first seek in the data file will happen at that point.
if (file == null)
file = createFileDataInput(positionToSeek);
IColumnSerializer columnSerializer = cf.getColumnSerializer();
file.seek(positionToSeek);
FileMark mark = file.mark();
// TODO only completely deserialize columns we are interested in
while (file.bytesPastMark(mark) < indexInfo.width)
{
IColumn column = columnSerializer.deserialize(file);
// we check vs the original Set, not the filtered List, for efficiency
if (columnNames.contains(column.name()))
{